import 'package:hc_bot_pro/common/tool/duration_ex.dart';
import 'package:hc_cure_sdk_flutter/model/cure/cure.dart';

class CurePlayerState {
  final Cure cure;
  final Duration duration;
  final String title;

  CurePlayerState({
    required this.cure,
    required this.duration,
    required this.title,
  });

  String get tip => cure.tip;

  //is over
  bool _isOver = false;

  bool get isOver => _isOver;

  set isOver(bool value) {
    _isOver = value;
  }

  Duration _timePosition = Duration.zero;

  Duration get timePosition => _timePosition;

  set timePosition(Duration value) {
    _timePosition = value;
  }

  String get timePositionDesc =>
      "${(duration - timePosition).minutesDesc}:${(duration - timePosition).secondsDesc}";

  //solution
  String? _lastSolution;

  String? get lastSolution => _lastSolution;

  set lastSolution(String? value) {
    _lastSolution = value;
  }

  bool get hasSolution => (null != _lastSolution);

  ///
  bool isMusicStandby = false;
}
